/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-09-20
**/
@Entity
@Data
@Table(name="course_signin")
public class CourseSignin implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "signin_id")
    @ApiModelProperty(value = "主键ID")
    private Long signinId;

    @Column(name = "course_name")
    @ApiModelProperty(value = "课程名称")
    private String courseName;

    @Column(name = "class_no")
    @ApiModelProperty(value = "班级编号")
    private String classNo;

    @Column(name = "class_name")
    @ApiModelProperty(value = "班级名称")
    private String className;

    @Column(name = "name")
    @ApiModelProperty(value = "姓名")
    private String name;

    @Column(name = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    @Column(name = "create_time")
    @ApiModelProperty(value = "签到时间")
    private Timestamp createTime;

    @Column(name = "group_no")
    @ApiModelProperty(value = "组号")
    private String groupNo;

    @Column(name = "open_id")
    @ApiModelProperty(value = "openid")
    private String openId;

    @Column(name = "pay_meals")
    @ApiModelProperty(value = "交餐费")
    private Integer payMeals;

    @Column(name = "course_no")
    @ApiModelProperty(value = "课程编号")
    private String courseNo;

    @Column(name = "channel_source")
    @ApiModelProperty(value = "渠道来源")
    private String channelSource;

    @Column(name = "sign_type")
    @ApiModelProperty(value = "签到类型 0：正常，1：手工签到")
    private Integer signType;

    @Column(name = "reason")
    @ApiModelProperty(value = "签到原因")
    private String reason;

    @Column(name = "signin_pic")
    @ApiModelProperty(value = "签到图片")
    private String signinPic;

    public void copy(CourseSignin source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}